Mdadm
mdadm-wa Linuks päkeij für administār Linuks MD arrays (softwär RAID). Noutis: mdadm modifai initrd dè biheivior. | latest release date = | programming language = C | operating system = Linux | language = English | status = Active | genre = Disk utility | license = GNU General Public License | website = http://neil.brown.name/blog/mdadm }} mdadm is a Linux utility used to manage software RAID devices. The name is derived from the md (multiple device) device nodes it administers or manages, and it replaced a previous utility mdctl. The original name was "Mirror Disk", but was changed as the functionality increased. mdadm is free software licensed under version 2 or later of the GNU General Public License - maintained and copyrighted to Neil Brown of SUSE. Overview Linux software RAID configurations can include anything presented to the Linux kernel as a block device. This includes whole hard drives (for example, /dev/sda), and their partitions (for example, /dev/sda1). RAID configurations * RAID 0 – Block level striping. MD can handle devices of different lengths, the extra space on the larger device is then not striped. * RAID 1 – Mirror. * RAID 3 – ? * RAID 4 – Like RAID 0, but with an extra device for the parity. * RAID 5 – Like RAID 4, but with the parity distributed across all devices. * RAID 6 – Like RAID 5, but with two parity segments per stripe. * RAID 10 – Take a number of RAID 1 mirrorsets and stripe across them RAID 0 style. Note that RAID 10 is distinct from RAID 0+1, which consists of a top-level RAID 1 mirror composed of high-performance RAID 0 stripes directly across the physical hard disks. A single-drive failure in a RAID 10 configuration results in one of the lower-level mirrors entering degraded mode, but the top-level stripe performing normally (except for the performance hit). A single-drive failure in a RAID 0+1 configuration results in one of the lower-level stripes completely failing, and the top-level mirror entering degraded mode. Which of the two setups is preferable depends on the details of the application in question, such as whether or not spare disks are available, and how they should be spun up. Non-RAID configurations * Linear – concatenates a number of devices into a single large MD device. * Multipath – provides multiple paths with failover to a single device. * Faulty – a single device which emulates a number of disk-fault scenarios for testing and development. * Container – a group of devices managed as a single device, in which one can build RAID systems. Features The original (standard) form of names for md devices is /dev/md, where is a number between 0 and 99. More recent kernels have support for names such as /dev/md/Home. Under 2.4.x kernels and earlier these two were the only options. Both of them are non-partitionable. Since 2.6.x kernels, a new type of MD device was introduced, a partitionable array. The device names were modified by changing md to md_d. The partitions were identified by adding p; thus /dev/md/md_d2p3 for example. Since version 2.6.28 of the Linux kernel mainline, non-partitionable arrays can be partitioned, the partitions being referred to in the same way as for partitionable arrays for example, /dev/md/md1p2. Since version 3.7 of the Linux kernel mainline, md supports TRIM operations for the underlying solid-state drives (SSDs), for linear, RAID 0, RAID 1, RAID 5 and RAID 10 layouts. Booting Since support for MD is found in the kernel, there is an issue with using it before the kernel is running. Specifically it will not be present if the boot loader is either (e)LiLo or GRUB legacy. It may not be present for GRUB 2. In order to circumvent this problem a /boot filesystem must be used either without md support, or else with RAID1. In the latter case the system will boot by treating the RAID1 device as a normal filesystem, and once the system is running it can be remounted as md and the second disk added to it. This will result in a catch-up, but /boot filesystems are usually small. With more recent bootloaders it is possible to load the MD support as a kernel module through the initramfs mechanism, this approach allows you to let the /boot filesystem be inside any RAID system without the need of a complex manual configuration. External metadata Besides its own formats for RAID volumes metadata, Linux software RAID also supports external metadata formats, since version 2.6.27 of the Linux kernel and version 3.0 of the mdadm userspace utility. This allows Linux to use various firmware- or driver-based RAID volumes, also known as "fake RAID". , there are two supported formats of the external metadata: * DDF (Disk Data Format), an industry standard defined by the Storage Networking Industry Association for increased interoperability. * Volume metadata format used by the Intel Matrix RAID, implemented on many consumer-level motherboards. mdmpd mdmpd is a daemon used for monitoring MD multipath devices, developed by Red Hat as part of the mdadm package. The program is used to monitor multipath (RAID) devices, and is usually started at boot time as a service, and afterwards running as a daemon. Enterprise storage requirements often include the desire to have more than one way to talk to a single disk drive so that in the event of some failure to talk to a disk drive via one controller, the system can automatically switch to another controller and keep going. This is called multipath disk access. The linux kernel implements multipath disk access via the software RAID stack known as the md (Multiple Devices) driver. The kernel portion of the md multipath driver only handles routing I/O requests to the proper device and handling failures on the active path. It does not try to find out if a path that has previously failed might be working again. That's what this daemon does. Upon startup, the daemon will fork and place itself in the background. Then it reads the current state of the md raid arrays, saves that state, and then waits for the kernel to tell it something interesting has happened. It then wakes up, checks to see if any paths on a multipath device have failed, and if they have then it starts to poll the failed path once every 15 seconds until it starts working again. Once it starts working again, the daemon will then add the path back into the multipath md device it was originally part of as a new spare path. If one is using the /proc filesystem, /proc/mdstat lists all active md devices with information about them. Mdmpd requires this to find arrays to monitor paths on and to get notification of interesting events. Päkeijs # apt-get install mdadm Reading package lists... Done Building dependency tree Reading state information... Done The following extra packages will be installed: * postfix Suggested packages: * procmail * postfix-mysql * postfix-pgsql * postfix-ldap * postfix-pcre * sasl2-bin * dovecot-common * postfix-cdb * postfix-doc Recommended packages: * default-mta * mail-transport-agent The following NEW packages will be installed: # mdadm # postfix 0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded. Need to get 1,447 kB of archives. After this operation, 4,799 kB of additional disk space will be used. Do you want to continue? Y/n Dawnloud #Get: http://hk.archive.ubuntu.com/ubuntu/ trusty-updates/main mdadm amd64 3.2.5-5ubuntu4.1 kB #Get: http://hk.archive.ubuntu.com/ubuntu/ trusty/main postfix amd64 2.11.0-1 kB Fetched 1,447 kB in 47s (30.2 kB/s) Preconfiguring packages ... Selecting previously unselected package mdadm. (Reading database ... 173928 files and directories currently installed.) Instoleiçion Preparing to unpack .../mdadm_3.2.5-5ubuntu4.1_amd64.deb ... Unpacking mdadm (3.2.5-5ubuntu4.1) ... Selecting previously unselected package postfix. Preparing to unpack .../postfix_2.11.0-1_amd64.deb ... Unpacking postfix (2.11.0-1) ... Processing triggers for ureadahead (0.100.0-16) ... ureadahead will be reprofiled on next reboot Processing triggers for doc-base (0.10.5) ... Processing 6 added doc-base files... Processing triggers for man-db (2.6.7.1-1ubuntu1) ... Processing triggers for ufw (0.34~rc-0ubuntu2) ... Setting up mdadm (3.2.5-5ubuntu4.1) ... Generating mdadm.conf... done. Removing any system startup links for /etc/init.d/mdadm-raid ... update-initramfs: deferring update (trigger activated) Generating grub configuration file ... Warning: Setting GRUB_TIMEOUT to a non-zero value when GRUB_HIDDEN_TIMEOUT is set is no longer supported. Found linux image: /boot/vmlinuz-3.13.0-40-generic Found initrd image: /boot/initrd.img-3.13.0-40-generic Found linux image: /boot/vmlinuz-3.13.0-32-generic Found initrd image: /boot/initrd.img-3.13.0-32-generic Found memtest86+ image: /memtest86+.elf Found memtest86+ image: /memtest86+.bin done * Starting MD monitoring service mdadm --monitor [ OK ] Postfix Setting up postfix (2.11.0-1) ... Adding group `postfix' (GID 125) ... Done. Adding system user `postfix' (UID 116) ... Adding new user `postfix' (UID 116) with group `postfix' ... Not creating home directory `/var/spool/postfix'. Creating /etc/postfix/dynamicmaps.cf Adding tcp map entry to /etc/postfix/dynamicmaps.cf Adding sqlite map entry to /etc/postfix/dynamicmaps.cf Adding group `postdrop' (GID 126) ... Done. /etc/aliases does not exist, creating it. Postfix was not set up. Start with cp /usr/share/postfix/main.cf.debian /etc/postfix/main.cf . If you need to make changes, edit /etc/postfix/main.cf (and others) as needed. To view Postfix configuration values, see postconf(1). After modifying main.cf, be sure to run '/etc/init.d/postfix reload'. Processing triggers for ureadahead (0.100.0-16) ... Processing triggers for initramfs-tools (0.103ubuntu4.2) ... update-initramfs: Generating /boot/initrd.img-3.13.0-40-generic W: mdadm: /etc/mdadm/mdadm.conf defines no arrays. Processing triggers for ufw (0.34~rc-0ubuntu2) ... Processing triggers for libc-bin (2.19-0ubuntu6.4) ... # Ùninstol postfix # apt-get remove postfix Reading package lists... Done Building dependency tree Reading state information... Done The following packages will be REMOVED: * postfix 0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded. After this operation, 3,609 kB disk space will be freed. Do you want to continue? Y/n y (Reading database ... 174168 files and directories currently installed.) Removing postfix (2.11.0-1) ... Processing triggers for man-db (2.6.7.1-1ubuntu1) ... Processing triggers for libc-bin (2.19-0ubuntu6.4) ... # Krieitiŋ en Rīmūviŋ mdadm Krieitiŋ mdadm Rīmūviŋ mdadm Rīmūving MDADM Array krieiten wa involv severol steps : # Yus sudo fdisk -l tu list ol disks. Si osou * Software RAID Riförènses Ikstörnol liŋk * * Linux RAID Wiki * * * * Category:Free software programmed in C Category:Free system software Category:Linux file system-related software Category:RAID Category:Linuks päkeij